let proto = module.exports;

proto.gameStatus = {
	NONE: 0, /* 等待操作 */
	WASH_CARD: 1, /* 洗牌 */
	SEND_CARDS: 2, /* 发牌 */
	CHANGE_CARD: 3, /* 切牌 */
	USER_OPERATE: 4, /* 用户操作 */
	RESULT: 5, /* 显示结果 */
	USER_DOUBLE: 6,//加倍
	USER_QIANG: 7, //抢关
};

proto.gameStatusTm = {
	NONE: 0, /* 等待操作 */
	WASH_CARD: 1, /* 洗牌 */
	CHANGE_CARD: 1, /* 切牌 */
	SEND_CARDS: 2, /* 发牌 */
	USER_DOUBLE: 15, //加倍
	USER_QIANG: 15, //抢关
	USER_OPERATE: 15, /* 用户操作 */
	RESULT: 0, /* 显示结果 */
};

//游戏操作
proto.operateType = {
	NONE: 0,//未操作
	PASS: 1, //过牌
	OUT: 2,  //出牌
	SEND: 3,  //发牌
}

//游戏操作
proto.outSortType = {
	HEI3: 1,//黑桃3
	HONG3: 2, //红桃3
	WIN: 3,  //赢家做庄
	TURN: 4,  //轮流做庄
}


proto.cardType = {
	ERROR: 0,                   // 错误
	SINGLE: 1,                  // 单牌
	DOUBLE: 2,                  // 对子
	SINGLE_LINE: 3,             // 单连
	DOUBLE_LINE: 4,             // 对连
	THREE_LINE: 5,              // 三不带
	THREE_LINE_TAKE_ONE: 6,     // 三带1
	THREE_LINE_TAKE_TWO: 7,     // 三带2
	FOUR_LINE_TAKE_X: 8,        // 四带X
	BOMB_CARD: 9,              // 炸弹
	TIAN_BOMB: 10,            //天炸
};

//关的类型
proto.guanType = {

	DAN: 1,
	SHUANG: 2,
	BEI: 3,
	FAN: 4,
}


//庄家推送
proto.GAME_BANKER_PUSH = 601;
proto.gameBankerPush = function (uid) {
	return {
		type: this.GAME_BANKER_PUSH,
		data: { uid },
	};
};


//发玩家手牌
proto.GAME_SEND_CARDS_PUSH = 603;
proto.gameSendCardPush = function (handCards) {

	return {
		type: this.GAME_SEND_CARDS_PUSH,
		data: { handCards },
	};
};

//开始操作推送
proto.GAME_USER_OPERATE_START_PUSH = 604;
proto.gameUserOperateStartPush = function (uid, cards, lastOperateUid, tick) {
	return {
		type: this.GAME_USER_OPERATE_START_PUSH,
		data: { uid, cards, tick, lastOperateUid },
	};
};


//玩家托管
proto.GAME_TRUST_NOTIFY = 505;
proto.GAME_TRUST_PUSH = 605;
proto.gameTrushPush = function (uid, trust) {
	return {
		type: this.GAME_TRUST_PUSH,
		data: {
			uid: uid,
			trust: trust,
		},
	};
};



//游戏结果推送
proto.GAME_RESULT_PUSH = 606;
proto.gameResultPush = function (result, hasChuntian, leftCards, plusInfo) {
	return {
		type: this.GAME_RESULT_PUSH,
		data: {
			plusInfo,
			result: result,
			hasChuntian: hasChuntian,
			allLeftCards: leftCards
		},
	};
};


//牌面回房
proto.GAME_REVIEW_NOTIFY = 507;
proto.GAME_REVIEW_PUSH = 607;
proto.gameReviewPush = function (list) {
	return {
		type: this.GAME_REVIEW_PUSH,
		data: {
			list: list,
		},
	};
};

//局数推送
proto.GAME_BUREAU_PUSH = 608;
proto.gameBureauPush = function (curBureau) {
	return {
		type: this.GAME_BUREAU_PUSH,
		data: {
			curBureau: curBureau,
		},
	};
};


proto.GAME_END_PUSH = 609;
proto.gameEndPush = function (result, winMost, loseMost, creater, plusInfo) {

	let curResult = {
		type: this.GAME_END_PUSH,
		data: {
			result: result,
			winMost: winMost,
			loseMost: loseMost,
			creater: creater,
			plusInfo: plusInfo,
		},
	};
	return curResult;
};


//推送操作
proto.GAME_USER_OPERATE_NOTIFY = 510;
proto.GAME_USER_OPERATE_PUSH = 610;
proto.gameUserOperatePush = function (uid, operateInfo) {
	return {
		type: this.GAME_USER_OPERATE_PUSH,
		data: { uid, operateInfo },
	};
};


//开始抢关推送
proto.GAME_START_QIANG_GUAN_PUSH = 611;
proto.gameStartQiangGuanPush = function (uid, tick) {
	return {
		type: this.GAME_START_QIANG_GUAN_PUSH,
		data: { uid, tick },
	};
};

//玩家抢关推送
proto.GAME_QIANG_GUAN_NOTIFY = 512;
proto.GAME_QIANG_GUAN_PUSH = 612;
proto.gameQiangGuanPush = function (uid, isQiang, qiangGuanUser) {
	return {
		type: this.GAME_QIANG_GUAN_PUSH,
		data: { uid, isQiang, qiangGuanUser },
	};
};


proto.GAME_USER_DOUBLUE_NOTIFY = 513;
proto.GAME_USER_DOUBLUE_PUSH = 613;
proto.gameUserDoublePush = function (uid, isDouble) {
	return {
		type: this.GAME_USER_DOUBLUE_PUSH,
		data: { uid, isDouble },
	};
};


//玩家选择切牌
proto.GAME_USER_CHOOSE_WASH_NOTIFY = 516;
proto.GAME_USER_CHOOSE_WASH_PUSH = 616;
proto.userChooseWashResult = function (uid, userWashList, success, message) {
	return {
		type: this.GAME_USER_CHOOSE_WASH_PUSH,
		data: { uid, userWashList, success, message },
	};
};



//----------------------------调试功能------------------------------------

//换牌
proto.GAME_SET_TEST_CARDS_NOTIFY = 551;
proto.GAME_SET_TEST_CARDS_PUSH = 651;
proto.gameSetTestCardsPush = function (isSuccess) {
	return {
		type: this.GAME_SET_TEST_CARDS_PUSH,
		data: { isSuccess },
	};
};


//查询牌库
proto.GAME_GET_TEST_CARDS_NOTIFY = 552;
proto.GAME_GET_TEST_CARDS_PUSH = 652;
proto.gameGetTestCardsPush = function (uid, allCardsData, testCards) {
	return {
		type: this.GAME_GET_TEST_CARDS_PUSH,
		data: { uid, allCardsData, testCards },
	};
};





